@echo off
@REM 定义变量
setlocal
if "%3"==".c" (
    set "compiler=%1\bin\gcc"
) else (
    set "compiler=%1\bin\g++"
)
set "input=%2"
set "outputFile=%4"
set "output=%5"
set "arg=%6"

set "command=%compiler% %arg% -save-temps -masm=intel %input% -o %outputFile% "
echo doing: %command%
%command% || goto terminate

if not exist "%output%" mkdir "%output%"
move "%outputFile%.*" "%output%"
:terminate
endlocal
@echo on